package net.koodar.forge.log.event;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.koodar.forge.log.service.EventOperateLogService;
import org.springframework.context.ApplicationListener;

/**
 * @author liyc
 */
@Slf4j
@RequiredArgsConstructor
public class OperateLogEventHandler implements ApplicationListener<OperateLogEvent> {

	private final EventOperateLogService operateLogService;

	@Override
	public void onApplicationEvent(OperateLogEvent event) {
		log.debug("保存操作日志:{}", Thread.currentThread().getId());
		operateLogService.add(event);
	}
}
